package ltd.hxya.novel.book.controller;


import io.swagger.v3.oas.annotations.Operation;
import ltd.hxya.novel.book.dto.NewsInfoRespDto;
import ltd.hxya.novel.book.service.NewsInfoService;
import ltd.hxya.novel.book.utils.resp.RestResp;
import ltd.hxya.novel.common.bean.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/book/news")
public class NewsController {


    @Autowired
    private NewsInfoService newsInfoService;

    /**
     * 最新新闻列表查询接口(首页)
     */
    @Operation(summary = "首页最新新闻列表查询接口")
    @GetMapping("latest_list")
    public Result<List<NewsInfoRespDto>> listLatestNews() {
        return newsInfoService.listLatestNews();
    }

}
